import React, {Component} from 'react';
import {Image, StyleSheet, Text, View} from 'react-native';
import {Flex, WingBlank} from '@ant-design/react-native';
import moment from 'moment';

class HdCard extends Component {
    constructor(props) {
        super(props);
    }
    render() {
        return (
            <WingBlank>
                <Flex style={styles.flex}>
                    <Flex>
                        <Image
                            style={styles.image}
                            source={require('~/assets/shouye/demo22x.png')}
                        />
                    </Flex>
                    <Flex style={styles.itemtextview}>
                        <Flex
                            style={styles.item}
                            justify={'start'}
                            align={'start'}>
                            <Text numberOfLines={1} style={styles.lowername}>
                                {this.props.item.CompanyName}{' '}
                                {this.props.item.BuildingName}
                            </Text>
                        </Flex>
                        <Flex style={styles.item}>
                            <Text style={styles.text}>
                                {this.props.item.ProjectName}
                            </Text>
                            <Text style={styles.text}>
                                {'  '}
                                {moment().format(
                                    'YYYY/MM/DD',
                                    this.props.item.ValidStart,
                                )}
                                -
                                {moment().format(
                                    'YYYY/MM/DD',
                                    this.props.item.ValidEnd,
                                )}
                            </Text>
                        </Flex>
                        <Flex style={styles.item}>
                            <Text style={styles.text}>
                                活动车位数:{this.props.item.ParkingCount}
                                {'  '}
                            </Text>
                            <Text style={styles.text}>
                                售价: {this.props.item.PriceMarketMin}--
                                {this.props.item.PriceMarketMax}
                            </Text>
                        </Flex>
                        <Flex direction={'row'} style={styles.item}>
                            <View style={{marginTop: 9}}>
                                <Image
                                    style={{
                                        width: 10,
                                        height: 11,
                                    }}
                                    source={require('~/assets/shouye/dizhi_12x.png')}
                                />
                            </View>
                            <Text numberOfLines={1} style={styles.text}>
                                {this.props.item.CityName}
                            </Text>
                        </Flex>
                        <Flex direction={'row'} style={styles.item}>
                            <Text numberOfLines={1} style={styles.text}>
                                活动负责人:{this.props.item.username}
                                电话:{this.props.item.phone}
                            </Text>
                        </Flex>
                    </Flex>
                </Flex>
            </WingBlank>
        );
    }
}

export default HdCard;

const styles = StyleSheet.create({
    flex: {
        backgroundColor: 'white',
        height: 140,
        marginTop: 10,
        borderRadius: 5,
    },
    image: {
        width: 105,
        height: 105,
        margin: 10,
    },
    itemtextview: {
        flexDirection: 'column',
        marginLeft: 7,
    },
    item: {
        width: '78%',
    },
    lowername: {
        fontSize: 15,
        color: '#333333',
        fontWeight: 'bold',
        marginTop: 8,
    },
    text: {
        fontSize: 12,
        color: '#666666',
        marginTop: 8,
    },

    biaoqian: {
        marginTop: 14,
        width: 40,
        height: 20,
        fontSize: 10,
        borderRadius: 2,
        textAlign: 'center',
        paddingTop: 2,
        backgroundColor: '#EB5A31',
        color: '#FFFFFF',
        marginBottom: 15,
    },
    money: {
        marginTop: 14,
        fontSize: 14,
        marginLeft: 12,
        color: '#EB5A31',
        marginBottom: 15,
    },
});
